package com.atguigu.controller;

import com.atguigu.domain.User;
import com.atguigu.feign.UserClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.websocket.server.PathParam;

/**
 * ConsumerFeignController
 *
 * @Author: 马伟奇
 * @CreateTime: 2021-03-05
 * @Description:
 */
@RestController
@RequestMapping("/feign")
public class ConsumerFeignController {

    @Autowired
    private UserClient userClient;

    @RequestMapping("/{id}")
    public User findUserById(@PathVariable(value = "id") Integer id){
        User user = userClient.findUserById(id);
        return user;
    }

}